projects
/
project
/
libubox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bbd846e
)
jshn: drop json_select warnings when called from json_get_values()
author
Felix Fietkau
<
[email protected]
>
Sun, 2 Feb 2014 14:22:23 +0000
(15:22 +0100)
committer
Felix Fietkau
<
[email protected]
>
Sun, 2 Feb 2014 14:22:23 +0000
(15:22 +0100)
Signed-off-by: Felix Fietkau <
[email protected]
>
sh/jshn.sh
patch
|
blob
|
history
diff --git
a/sh/jshn.sh
b/sh/jshn.sh
index 85c4151b2a0c3ad53174c085260ffec81e8d391f..b3cd43c7d05844af414c925c3b3b02ccc99a6b99 100644
(file)
--- a/
sh/jshn.sh
+++ b/
sh/jshn.sh
@@
-206,6
+206,7
@@
json_get_keys() {
json_get_values() {
local _v_dest="$1"
local _v_keys _v_val _select=
+ local _json_no_warning=1
unset "$_v_dest"
[ -n "$2" ] && {
@@
-267,7
+268,8
@@
json_select() {
_json_set_var JSON_CUR "$cur"
;;
*)
- echo "WARNING: Variable '$target' does not exist or is not an array/object"
+ [ -n "$_json_no_warning" ] || \
+ echo "WARNING: Variable '$target' does not exist or is not an array/object"
return 1
;;
esac